var express = require("express");
var app = express();

//解决跨域问题的代码
app.all("*", function(req, res, next) {
  res.header("Access-Control-Allow-Origin", "*");
  res.header("Access-Control-Allow-Headers", "X-Requested-With");
  res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS");
  res.header("X-Powered-By", "3.2.1");
  res.header("Content-Type", "application/json;charset=utf-8");
  next();
});

app.get("/xxx", function(req, res) {
  var tabList = [
    "推荐",
    "居家生活",
    "服饰鞋包",
    "美食酒水",
    "个护清洁",
    "母婴亲子",
    "全球特色"
  ];
  res.send(tabList);
});

app.listen(2121, function() {
  console.log("监听2121成功");
});
